#include "process.h"

#include <string.h>
#include <stdio.h>
#include <unistd.h>
#define STYLE '#'
#define NUM 101


void Process()
{
    const char*lable = "|/-\\";
    int cnt = 0;
    char buff[NUM];
    memset(buff,0,sizeof(buff));
    int len = strlen(lable);
    while(cnt <= 100)
    {
        
        printf("[%-100s][%d%%][%c]\r",buff,cnt,lable[cnt % len]);
        fflush(stdout);
        buff[cnt] = STYLE;
        cnt++;
        if(cnt != NUM - 1)
        buff[cnt] = '>';
        usleep(20000);
    }
    printf("\r\n");
}
